package com.test.demos.dao;

import com.test.demos.po.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductDAO {
	//新增
	int saveProduct(Product product);
	int saveProductOracle(Product product);
	//批量添加

	int  saveProductAll (@Param("list") List<Product> list);
	//删除by编号
	int deleteProductByBh(@Param("id") Integer id);
	//根据uid删除
	int deleteProductByUID(@Param("uid") String uid);
	//删除by条件
	int deleteProductByCondition(@Param("product") Product product);
	//修改
	int updateProduct(Product product);
	//查询
	List<Product> getProductPageByCondition(
		@Param("product") Product product,
		@Param("start") int start,
		@Param("range") int range);

	List<Product> getProductPageByConditionOrder(
		@Param("product") Product product,
		@Param("start") int start,
		@Param("range") int range,
		@Param("orderStr") String orderStr);

	int countProductByCondition(@Param("product") Product product);
	List<Product> getProductByCondition(@Param("product") Product product);
	Product getOneProduct(@Param("bh") Integer bh);
	Product getOneProductByUID(@Param("uid") String uid);

}
